set(PLASMA_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(GCC_OPTIMIZATION_FLAGS "-O3")
set(GCC_DEBUG_FLAGS "-g")
set(CMAKE_LIBRARY_PATH "/opt/lib:/opt/local/lib:${CMAKE_LIBRARY_PATH}")
set(EUROPA_MODULE_INCLUDE_DIRS "")
if(OPTIMIZE)
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_OPTIMIZATION_FLAGS}")
  add_definitions(-DEUROPA_FAST=1)
else()
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_DEBUG_FLAGS} -Wall -fno-omit-frame-pointer")

endif(OPTIMIZE)

if(COVERAGE)
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -Wall -W -Wshadow -Wunused-variable -Wunused-parameter -Wunused-function -Wunused -Wno-system-headers -Wno-deprecated -Woverloaded-virtual -Wwrite-strings -fprofile-arcs -ftest-coverage")
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} g -O0 -Wall -W -fprofile-arcs -ftest-coverage")
  
  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
  if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
    link_libraries(gcov)
  endif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
endif(COVERAGE)

if(SIXTYFOUR)
  message(STATUS "Configuring for 64-bit build")
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64")
  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m64")
  set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} -m64")
  add_definitions(-DEUROPA_64_BIT_PLATFORM)
else()
  message(STATUS "Configuring for 32-bit build")
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32")
  set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} -m32")
endif(SIXTYFOUR)

if(BOOST_INCLUDE_PATH)
  include_directories(${BOOST_INCLUDE_PATH})
else()
  find_package(Boost)
  if(Boost_FOUND)
    include_directories(${Boost_INCLUDE_DIRS})
  else()
    message(FATAL_ERROR "Failed to find boost libraries")
  endif()
endif()

add_subdirectory(TinyXml)
add_subdirectory(Utils)
add_subdirectory(ConstraintEngine)
add_subdirectory(PlanDatabase)
add_subdirectory(RulesEngine)
add_subdirectory(TemporalNetwork)
add_subdirectory(NDDL)
add_subdirectory(Solvers)
add_subdirectory(Resource)
add_subdirectory(ANML)
add_subdirectory(System)
